// import 'package:asm/entities/file_model.dart';
// import 'package:asm/entities/file_upload_entity.dart';
// import 'package:wechat_assets_picker/wechat_assets_picker.dart';
//
// import 'package:path/path.dart' as path;
//
// extension FileExt on AssetEntity {
//   Future<FileUploadEntity?> toFileUploadEntity() async {
//     final originPath = (await originFile)?.path;
//     final ob = await originBytes;
//
//     if (originPath == null || ob == null) return null;
//
//     final time = DateTime.now().millisecondsSinceEpoch;
//     final entity = FileUploadEntity(
//         type: typeInt,
//         name: '$time${path.extension(originPath)}',
//         originBytes: ob);
//
//     if (typeInt == 2) {
//       entity.thumbnailName = 'thumbnail-$time.png';
//       entity.thumbnailData = await thumbnailData;
//     }
//
//     entity.path = originPath;
//
//     return entity;
//   }
//
//   Future<FileModel?> toFileModel() async {
//     return FileModel.fromAssetsEntity(this);
//   }
// }
